
import router from '@/router';
class storgeHelper {

    getItem(key: string) {
       return localStorage.getItem(key);
    }

    setItem(key: string, value: any) {
        localStorage.setItem(key, value);
    }

    clearItem(key: string){
        localStorage.removeItem(key);
    }

    getAuthItem() {
         
        let result = localStorage.getItem('auth');
        if (!result || result.length == 0) {
            alert('您还没有登录 请登录后重试');
            router.push({ path: '/login' });
        }
    }
}
export const MyStorge = new storgeHelper();